(function () {
    angular.module('app')
        .component('xxStockManage',{
            templateUrl:'/app/drug-manager/stock-manage/stock-manage.html',
            controller:ctrl
        });

    function ctrl($scope,$state,userService,StockManageFactory,mockHttp) {
        $scope.drugName = '';
        $scope.drugList = mockHttp.allDrug['res'];
        var shopId = userService.user['shopId'];
        /*function getStockInfo(body){
            function cb(err, res) {
                //console.log(err,res);
                if(!err) {
                    $scope.drugList = res['res'];
                }
            }
            StockManageFactory.getStockInfo(shopId, cb);
        }
        getStockInfo($scope.disease);*/
        console.log(shopId);
        $scope.updateStock = function (drugId) {
            $state.go('drug-manager.update-stock',{shopId:shopId,drugId:drugId});
        };
    }
})();